<template>
    <!-- 换一批 -->
    <div class="title_clearfix">
            <p class="title_clearfix_left">推荐关注</p>
            <div class="title_clearfix_rigth">
                <el-icon :style="{fontSize:'13px',color:'#b1b5c1',fontWeight:'900'}"><RefreshRight/></el-icon>
                <a class="title_clearfix_rigth_p" @click="changeBarch">换一批</a>
            </div>
    </div>
    <!--关注导航栏 -->
    <div class="list">
        <ul class="list_ul">
            <li class="list_ul_li" v-for="item in attentionList " :key="item.accid">
                <div  class="list_ul_li_content">
                    <img :src="item.avatar" class="list_ul_li_content_img">
                    <p class="list_ul_li_content_p">{{item.account}}</p>
                    <div class="list_ul_li_content_button">
                         <el-button color="#f9ebf1" round  size="default"><p class="list_ul_li_content_button_p">
                            <el-icon :style="{fontSize:'12px',}"><Plus/></el-icon>
                            关注</p></el-button>
                    </div>
                </div>
            </li>                                                           
        </ul>
    </div>
    <DanceList :GeneralData='RecommendListData'/>
</template>

<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
    name: "Attention",
});
</script>

<script setup lang="ts">
import {RefreshRight,Plus} from "@element-plus/icons-vue"
import type {attentionType,getattentionList_cotentType} from "@/api/Studio"
import { DefaultDanceListItemType, RequestDefaultDanceList } from "@/api/Resource";
import {getattentionList} from "@/api/Studio"
import { onMounted, ref }  from "vue"
//定义数据保存对应得数据类型
const attentionList =ref<getattentionList_cotentType>()
    //创建一个首页数据
const RecommendListData = ref<DefaultDanceListItemType[]>([])
//初始发送请求
onMounted(()=>{
    getAttentionList()
})
const getAttentionList =async (value=1)=>{
    const result = await getattentionList(value)
    attentionList.value = result.content
}
const changeBarch=()=>{
    const randomMath = Math.floor(Math.random()*10)
    getAttentionList(randomMath)

}
onMounted(() => {
    getRecommendList()
})

//进入推荐页就请求数据
 const getRecommendList=async()=>{
//    console.log(route.query.column);
    const re = await RequestDefaultDanceList(10)
    console.log(re.content,'11');
    RecommendListData.value = re.content
 }
</script>

<style lang="scss" scoped>        

    .title_clearfix{
        display: flex;
        justify-content: space-between;
        padding: 18px 0;
        .title_clearfix_rigth{
            display: flex;
            .title_clearfix_rigth_p{
                margin-left: 10px;
                cursor: pointer;
            }
        }
        p{
            color: #b1b1b1;
            font-size: 14px;
        }
    }

    .list{
        .list_ul{
            width: 1200px;
            height: 160px;
            display: flex;
            justify-content: space-around;
            margin-bottom: 20px;
            .list_ul_li{
                width: 115px;
                padding: 16px 12px;
                background-color: #ffffff;
                .list_ul_li_content{
                    display: flex;
                    flex-direction: column;
                    align-items: center;
                    justify-content: center;
                        .list_ul_li_content_img{
                            width: 60px;
                            height: 60px;
                            border-radius: 50%;
                            text-align: center;
                            margin-bottom: 10px;
                        }
                        .list_ul_li_content_p{
                            color: #7d8090;
                            width: 115px;
                            font-size: 14px;
                            text-align: center;
                            white-space: nowrap;
                            overflow: hidden;
                            text-overflow: ellipsis;
                        }
                        .list_ul_li_content_button{
                            display: flex;
                            margin-top: 8px;
                            .list_ul_li_content_button_p{
                                color: #f93684;
                                font-size: 12px;
                            }
                        }
                }
            }
        }
    }
</style>